
program drop _all

/* THIS PROGRAM IMPLEMENTS GROWTH REGRESSIONS IN TABLE 7 (cols.1-2)
   NOTE: 
   - All the source and results files are saved at single directory: C:\RESTAT\
   - This program and data were written such that all can be run IC STATA-ver. 10.1. 
   - HOWEVER, original results run in earlier ver. STATA 7 (thus potential differences in some decimals 
     due to software updates or roundings may occur) */
  

program define GROWTH
clear all
set more off
set memory 90m
set matsize 800
use C:\RESTAT\data1.dta, replace
log using C:\RESTAT\Tab7_tobit.log, replace                     

                       tsset firm year
  

#delimit ;  

 /* RESTRICT TO GROWTH SAMPLE */
                   
                    keep if growth~=. & FG~=. & ageT~=. & sales~=. & AS~=. & ES~=. & FORdirect~=. &
                          intang~=. & ESgap~=. & gap~=. & solvency~=. ;


/* DUMMY FOR TECHNOLOGY laggards/laggards */

                    display"CREATE DUMMY TECH=1 FOR TECHNOLOGY laggards, TECH=0(laggards)";
                    gen TECH=0;
                    replace TECH=1 if tech_diffIND>=0 & tech_diffIND~=. & tech_diffIND~=99; 
                    replace TECH=. if  (tech_diffIND==.|tech_diffIND==99) ;
  

 
           /* gen firm-level means */
            
                    sort firm ;
                    by firm: egen avsales=mean(sales);
                    by firm: egen avsales2=mean(sales2);
                    by firm: egen avESgap=mean(ESgap);
                    by firm: egen avFG=mean(FG);                 
                    by firm: egen avageT=mean(ageT);
                    by firm: egen avageT2=mean(ageT2);
                    by firm: egen avAS=mean(AS);
                    by firm: egen avES=mean(ES);
                    by firm: egen avFORdirect=mean(FORdirect);
                    by firm: egen avintang=mean(intang);
                    by firm: egen avgap=mean(gap);
                    by firm: egen avsolvency=mean(solvency);
 

/*
/* SPECIFICATION RUN */                    
                   /* display"TECHNOLOGY LEADERS";   
                   keep if TECH==1 & TECH~=.;*/
                 
                   display"TECHNOLOGY LAGGARDS"; 
                   keep if TECH==0 & TECH~=.; 
*/
                   tsset firm year ;


/* Note: NO_FOR dummy multicollinear with other dummies when we split indust., need to be dropped */

/* *********************************** TOBIT: Tab 7 (col.1) TECHNOLOGY LAGGARDS (TECH==0) ***************** */

                  xi:tobit growth FG STATIC ageT ageT2 sales sales2 AS ES FORdirect intang gap ESgap 
                                    D89 solvency year94-year00 i.primaryu*trend reg1-reg6                                   
                                    konkurz liquidate both OUT_BR 
                                    avFG avageT avageT2 avsales avsales2 avAS avES avFORdirect avintang 
                                    avgap avESgap avsolvency if TECH==0,ll(-1);
                   
 
/* *********************************** TOBIT: Tab 7 (col.2) TECHNOLOGY LEADERS (TECH==1) ***************** */

                  xi:tobit growth FG STATIC ageT ageT2 sales sales2 AS ES FORdirect intang gap ESgap 
                                    D89 solvency year94-year00 i.primaryu*trend reg1-reg6                                   
                                    konkurz liquidate both OUT_BR 
                                    avFG avageT avageT2 avsales avsales2 avAS avES avFORdirect avintang 
                                    avgap avESgap avsolvency if TECH==1,ll(-1);
                   
              

             
#delimit cr
log close
end
